home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig09_10.jar / Ch09 / Fig09_10 / Cylindr2.h < prev    next >
C/C++ Source or Header  |  1997-11-09  |  653b  |  27 lines

  1. // Fig. 9.10: cylindr2.h
  2. // Definition of class Cylinder
  3. #ifndef CYLINDR2_H
  4. #define CYLINDR2_H
  5.  
  6. #include "circle2.h"
  7.  
  8. class Cylinder : public Circle {
  9.    friend ostream &operator<<( ostream &, const Cylinder & );
  10.  
  11. public:
  12.    // default constructor
  13.    Cylinder( double h = 0.0, double r = 0.0,
  14.              int x = 0, int y = 0 );
  15.  
  16.    void setHeight( double );   // set height
  17.    double getHeight() const;   // return height
  18.    double area() const;        // calculate and return area
  19.    double volume() const;      // calculate and return volume
  20.  
  21. protected:
  22.    double height;              // height of the Cylinder
  23. };
  24.  
  25. #endif
  26.  
  27.